<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Language" content="en-ca" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="Installation" />
        <link rel="stylesheet" type="text/css" href="../style.css" />
        <title>Installation</title>
        <style type="text/css">
            ul {
                list-style-type: square;
            }
        </style>
    </head>
    <body>
        <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
            <tr>
                <td class="NavBar-Cell">
                    <a title="NAnt home page" href="http://nant.sourceforge.net"><b>NAnt</b></a> <img alt="->" src="../images/arrow.gif" />
                    <a href="../index.html">Help</a> <img alt="->" src="../images/arrow.gif" /> <a href="index.html">
                        Introduction</a> <img height="9" alt="->" src="../images/arrow.gif" width="13" />
                    Installation
                </td>
                <td class="NavBar-Cell" align="right">
                    v0.91-alpha2
                </td>
            </tr>
        </table>
        <h1>Installation</h1> <p class="topicstatus">[This is preliminary documentation and subject to change.]</p>
        <p>NAnt is available in either a source or binary distribution. The binary 
            distribution is all you need to use NAnt to build your projects, including 
            creating your own custom tasks, types and functions.</p>
        <p>If you are upgrading NAnt from a previous version, you must never install over 
            the top of your previous installation. Delete or rename the existing 
            installation directory before installing the new version of NAnt.</p>
        <h2>Installing from binaries</h2>
        <ol>
            <li>
                Download the binary distribution archive. Either <code>nant-bin.zip</code> or <code>
                    nant-bin.tar.gz</code> will work, the contents of each archive are the 
                same.</li>
            <li>
                Remove any previous versions of NAnt you may have installed.</li>
            <li>
                Extract the contents of the archive to the location you wish to install NAnt 
                (eg: C:\Program Files\NAnt in windows, or /usr/local/nant in Linux)
            </li>
            <li>
                Depending on your environment, create a wrapper script to run NAnt:
                <h3>Run NAnt using Microsoft.NET</h3>
                <ul>
                    <li>
                        Create a file called <code>nant.bat</code> in a directory that is included in 
                        the <code>PATH</code> system environment variable. (eg. <i>C:\WINDOWS</i>).
                    </li>
                    <li>
                        Add the following to <code>nant.bat</code>:
                        <pre>
@echo off
"C:\Program Files\NAnt\bin\NAnt.exe" %*
                        </pre>
                    </li>
                </ul>
                <h3>Run NAnt using Mono</h3>
                <ul style="list-style-type: none;">
                    <li>
                        <h4>Windows</h4>
                        <ul>
                            <li>
                                Create a file called <code>nant.bat</code> in a directory that is included in 
                                the <code>PATH</code> system environment variable. (eg. <i>C:\WINDOWS</i>).
                            </li>
                            <li>
                                Add the following to <code>nant.bat</code>:
                                <pre>
@echo off
mono "C:\Program Files\NAnt\bin\NAnt.exe" %*
                                </pre>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <h4>Linux / Cygwin</h4>
                        <ul>
                            <li>
                                Create a file called <code>nant</code> in a suitable location in your 
                                filesystem (eg. <i>/usr/local/bin</i>).
                            </li>
                            <li>
                                Add the following to <code>nant</code>:
                                <pre>
#!/bin/sh
exec mono /usr/local/nant/bin/NAnt.exe "$@"
                        </pre>
                            </li>
                            <li>
                                Ensure <code>nant</code> has permission to execute, eg:
                                <pre>
chmod a+x /usr/local/bin/nant
                        </pre>
                            </li>
                        </ul>
                    </li>
                </ul>
            </li>
            <li>
                Open a new command prompt (shell) and type <code>nant -help</code>. If 
                successful, you should see a usage message displaying available command line 
                options.</li>
            <li>
                (optional) Download and install NAnt-contrib or other third party extensions to 
                NAnt.</li>
        </ol>
        <h2>Installing from source</h2>
        <ol>
            <li>
                Download the source distribution archive. Either <code>nant-src.zip</code> or <code>
                    nant-src.tar.gz</code> will work, the contents of each archive are the 
                same.</li>
            <li>
                Remove any previous versions of NAnt you may have installed.</li>
            <li>
                Extract the contents of the archive to a temporary location. This should <b>not</b>
                be the location you wish to install NAnt to.</li>
            <li>
                Open a command prompt and change into the folder you extracted the archive to.</li>
            <li>
                Depending on your environment, build the NAnt distribution:
                <h3>Install NAnt using Microsoft .NET</h3>
                <ul>
                    <li>
                        <h4>GNU Make</h4>
                        <code>make install MONO= MCS=csc prefix=<i>installation-path</i></code>
                        <p>eg. <code>make install MONO= MCS=csc prefix="C:\Program Files"</code></p>
                    </li>
                    <li>
                        <h4>NMake</h4>
                        <code>nmake -f Makefile.nmake install prefix=<i>installation-path</i></code>
                        <p>eg. <code>nmake -f Makefile.nmake install prefix="C:\Program Files"</code></p>
                    </li>
                </ul>
                <h3>Install NAnt using Mono</h3>
                <ul>
                    <li>
                        <h4>GNU Make</h4>
                        <code>make install prefix=<i>installation-path</i></code>
                        <p>eg. <code>make install prefix="C:\Program Files"</code></p>
                    </li>
                    <li>
                        <h4>NMake</h4>
                        <code>nmake -f Makefile.nmake install MONO=mono CSC=mcs prefix=<i>installation-path</i></code>
                        <p>eg. <code>nmake -f Makefile.nmake install MONO=mono CSC=mcs prefix=/usr/local/</code></p>
                    </li>
                </ul>
                <p>
                    This will first build a bootstrap version of NAnt, and then use that to build 
                    and install the full version to <code><i>installation-path</i>/NAnt</code>.
                </p>
            </li>
            <li>
                Follow the instructions as for a binary release from step 5.</li>
        </ol>
    </body>
</html>
